<script setup lang="ts">
import { reactive, ref } from 'vue'
import { showNotify } from 'vant'
import { useStore } from '../store'
import { get, post, put } from '../utils/request'
import { useRoute, useRouter } from 'vue-router'
import { dayjs } from 'element-plus'
const router = useRouter()
const route = useRoute()

const list = reactive([])
const state= reactive({
  p: 1,
  total: 0
})
const page = (n: number) => {
  state.p = n
  get(
    'pay',
    {p: state.p}
  ).then(res => {
    list.splice(0)
    for (const i in res.data.data) {
      list.push(res.data.data[i])
    }
    state.total = res.data.total - 0
  }).catch(err => {
    alert(err.response.data.msg)
  })
}

document.title = "自助缴费"
page(1)
</script>

<template>
  <div style="min-height: 100vh;background:#eee">
    <el-table :data="list" style="width: 100%">
      <el-table-column prop="inputTime" label="付款时间" />
      <el-table-column prop="serialNumber" label="流水单号" />
      <el-table-column prop="price" label="金额" />
      <el-table-column prop="memo" label="备注" />
    </el-table>
    <el-pagination layout="prev, pager, next" :page-size="50" :total="state.total" :current-page="state.p" @current-change="page" />
  </div>

</template>
